All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.qd3d.math.Quaternion

java.lang.Object
   |
   +----quicktime.util.QTByteObject
           |
           +----quicktime.qd3d.math.Quaternion

public final class Quaternion
extends QTByteObject
implements QuickTimeLib, QuickDraw3DLib, Cloneable
Quaternion A quadruple of floating-point numbers that obeys the laws of quaternion arithmetic. A Quaternion transform will rotate and twist an object according to the mathematical properties of quaternions. Refer to TQ3Quaternion in QuickDraw3d


Variable Index

 o kNativeSize
This is the size (the number of bytes) that are required for this class

Constructor Index

 o Quaternion()
Creates a Quaternion object set to the identity.
 o Quaternion(float, float, float, float)
Creates a Quaternion object containing given data.

Method Index

 o clone()
Returns a copy of this class.
 o copy()
Returns a copy of the quaternion.
 o dot(Quaternion)
Returns the dot product of two quaternions, this and q2.
 o getEndianDescriptor()
Returns the EndianDescriptor for this class.
 o getW()
returns the w value
 o getX()
returns the position in the x direction
 o getY()
returns the position in the y direction
 o getZ()
returns the position in the z direction
 o interpolateFast(Quaternion, float)
Return a a quaternion that is a fast interpolation between the this and the specified quaternion.
 o interpolateLinear(Quaternion, float)
Return a a quaternion that is a linear interpolation between the this and the specified quaternion.
 o invert()
Returns the inverse of the quaternion.
 o isIdentity()
Returns rue if the quaternion is an identity quaternion.
 o matchReflection(Quaternion)
Returns a quaternion that is either identical to the quaternion specified by the q1 parameter or is the negative of q1, depending on whether q1 or its negative matches the orientation of the quaternion specified by the q2 parameter.
 o multiply(Quaternion)
Returns the product of the two quaternions, this and q2.
 o normalize()
Returns a normalized the quaternion.
 o setIdentity()
Sets the Quaternion to the identity quaternion.
 o setMatrix(Matrix4x4)
Sets a quaternion that has the same transformational properties as the matrix specified by the matrix parameter.
 o setRotateAboutAxis(Vector3D, float)
Sets a a rotate-about-axis quaternion that rotates an object by the angle angle around the axis specified by the axis parameter.
 o setRotateVectorToVector(Vector3D, Vector3D)
Sets a rotational quaternion that rotates objects around the origin in such a way that the transformed vector v1 matches the vector v2.
 o setRotateX(float)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
 o setRotateXYZ(float, float, float)
Sets a rotational quaternion that rotates an object by the specified angles around their specified axis.
 o setRotateY(float)
Sets a rotational quaternion that rotates an object by the specified angle around the y axis.
 o setRotateZ(float)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
 o setW(float)
sets the w value
 o setX(float)
sets the position in the x direction
 o setY(float)
sets the position in the y direction
 o setZ(float)
sets the position in the z direction

Variables

 o kNativeSize
 public static final int kNativeSize
This is the size (the number of bytes) that are required for this class

Constructors

 o Quaternion
 public Quaternion()
Creates a Quaternion object set to the identity.

QuickDraw3D::Q3Quaternion_SetIdentity

 o Quaternion
 public Quaternion(float w,
                   float x,
                   float y,
                   float z)
Creates a Quaternion object containing given data.

Parameters:
w - The final w value.
x - The final x position.
y - The final y position.
z - The final z position.

Methods

 o getEndianDescriptor
 public static final EndianDescriptor getEndianDescriptor()
Returns the EndianDescriptor for this class.

Returns:
an EndianDescriptor
 o getW
 public float getW()
returns the w value

 o getX
 public float getX()
returns the position in the x direction

 o getY
 public float getY()
returns the position in the y direction

 o getZ
 public float getZ()
returns the position in the z direction

 o setW
 public void setW(float w)
sets the w value

 o setX
 public void setX(float x)
sets the position in the x direction

 o setY
 public void setY(float y)
sets the position in the y direction

 o setZ
 public void setZ(float z)
sets the position in the z direction

 o copy
 public Quaternion copy()
Returns a copy of the quaternion.

QuickDraw3D::Q3Quaternion_Copy

Returns:
a copy of quaternion.
 o setIdentity
 public void setIdentity()
Sets the Quaternion to the identity quaternion.

QuickDraw3D::Q3Quaternion_SetIdentity

 o isIdentity
 public boolean isIdentity()
Returns rue if the quaternion is an identity quaternion.

QuickDraw3D::Q3Quaternion_IsIdentity

Returns:
true if the quaternion is an identity quaternion
 o invert
 public Quaternion invert()
Returns the inverse of the quaternion.

QuickDraw3D::Q3Quaternion_Invert

Returns:
the invert quaternion
 o multiply
 public Quaternion multiply(Quaternion q2)
Returns the product of the two quaternions, this and q2.

QuickDraw3D::Q3Quaternion_Multiply

Parameters:
q2 - a quaternion
Returns:
the product
 o normalize
 public Quaternion normalize()
Returns a normalized the quaternion.

QuickDraw3D::Q3Quaternion_Normalize

Returns:
the normalized quaternion
 o dot
 public float dot(Quaternion q2)
Returns the dot product of two quaternions, this and q2.

QuickDraw3D::Q3Quaternion_Dot

Parameters:
q2 - A quaternion.
Returns:
the dot product
 o setRotateAboutAxis
 public void setRotateAboutAxis(Vector3D axis,
                                float angle)
Sets a a rotate-about-axis quaternion that rotates an object by the angle angle around the axis specified by the axis parameter.

QuickDraw3D::Q3Quaternion_SetRotateAboutAxis

Parameters:
axis - The desired axis of rotation.
angle - The desired angle of rotation, in radians.
 o setRotateX
 public void setRotateX(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis.

QuickDraw3D::Q3Quaternion_SetRotate_X

Parameters:
angle - The desired angle of rotation around the x coordinate axis, in radians.
 o setRotateY
 public void setRotateY(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the y axis.

QuickDraw3D::Q3Quaternion_SetRotate_Y

Parameters:
angle - The desired angle of rotation around the y coordinate axis, in radians.
 o setRotateZ
 public void setRotateZ(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis.

QuickDraw3D::Q3Quaternion_SetRotate_Z

Parameters:
angle - The desired angle of rotation around the z coordinate axis, in radians.
 o setRotateXYZ
 public void setRotateXYZ(float xAngle,
                          float yAngle,
                          float zAngle)
Sets a rotational quaternion that rotates an object by the specified angles around their specified axis.

QuickDraw3D::Q3Quaternion_SetRotate_XYZ

Parameters:
xAngle - The desired angle of rotation around the x coordinate axis, in radians.
yAngle - The desired angle of rotation around the y coordinate axis, in radians.
zAngle - The desired angle of rotation around the z coordinate axis, in radians.
 o setMatrix
 public void setMatrix(Matrix4x4 matrix)
Sets a quaternion that has the same transformational properties as the matrix specified by the matrix parameter.

QuickDraw3D::Q3Quaternion_SetMatrix

Parameters:
matrix - A 4-by-by matrix.
 o setRotateVectorToVector
 public void setRotateVectorToVector(Vector3D v1,
                                     Vector3D v2)
Sets a rotational quaternion that rotates objects around the origin in such a way that the transformed vector v1 matches the vector v2. Both v1 and v2 should be normalized.

QuickDraw3D::Q3Quaternion_SetRotateVectorToVector

Parameters:
v1 - A three-dimensional vector.
v2 - A three-dimensional vector.
 o matchReflection
 public Quaternion matchReflection(Quaternion q2)
Returns a quaternion that is either identical to the quaternion specified by the q1 parameter or is the negative of q1, depending on whether q1 or its negative matches the orientation of the quaternion specified by the q2 parameter.

QuickDraw3D::Q3Quaternion_MatchReflection

Parameters:
q2 - A quaternion.
Returns:
a quaternion that is either q1 or the negative of q1, and that matches the orientation of q2.
 o interpolateFast
 public Quaternion interpolateFast(Quaternion q2,
                                   float t)
Return a a quaternion that is a fast interpolation between the this and the specified quaternion.

QuickDraw3D::Q3Quaternion_InterpolateFast

Parameters:
q2 - A quaternion.
t - An interpolation factor. This parameter should contain a value between 0.0 and 1.0.
Returns:
a quaternion
 o interpolateLinear
 public Quaternion interpolateLinear(Quaternion q2,
                                     float t)
Return a a quaternion that is a linear interpolation between the this and the specified quaternion.

QuickDraw3D::Q3Quaternion_InterpolateLinear

Parameters:
q2 - A quaternion.
t - An interpolation factor. This parameter should contain a value between 0.0 and 1.0.
Returns:
a quaternion
 o clone
 public Object clone()
Returns a copy of this class.

Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index